package com.hyk.commonLib.common.dialogView.base;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.databinding.ViewDataBinding;

import com.dylanc.viewbinding.base.ViewBindingUtil;
import com.hyk.commonLib.common.activity.BaseActivity;
import com.lxj.xpopup.core.BottomPopupView;

import lombok.Getter;

public class BottomPopupViewExt<DATA_BINDING extends ViewDataBinding> extends BottomPopupView {
    @Getter
    protected DATA_BINDING dataBinding;

    public BottomPopupViewExt(@NonNull Context context) {
        super(context);
        dataBinding = ViewBindingUtil.inflateWithGeneric(this, LayoutInflater.from(context), bottomPopupContainer, false);
        if (context instanceof BaseActivity<?>) {
            dataBinding.setLifecycleOwner(((BaseActivity<?>) context));
        }
    }

    @Override
    protected void addInnerContent() {
        View  contentView = dataBinding.getRoot();
        bottomPopupContainer.addView(contentView);
    }

//    @Override
//    protected void onCreate() {
//        super.onCreate();
//        applyTheme();
//    }

}
